/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   Module Name          : com.yaodian100.ec.product.entity.AddOnProductPage
   Module Description   :

   Date Created      : 2011/5/25
   Original Author   : feeling.wang
   Team              : yaodian100
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   MODIFICATION HISTORY
   ------------------------------------------------------------------------------
   Date Modified       Modified by       Comments
   ------------------------------------------------------------------------------
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
package com.yaodian100.ec.product.entity;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.yaodian100.core.common.entity.BaseEntity;

/**
 * @author feeling.wang
 * 
 */

@Entity
@Table(name = "EC_PRODUCT_COMMENT")
public class ProductComment extends BaseEntity {

	/**
	 * serial version
	 */
	private static final long serialVersionUID = -1147710608874615686L;
	@Id
	@Column(name = "PRODUCT_ID", length = 8)
	private String productId;

	@Column(name = "AVG_SCORE", nullable = false, columnDefinition = "NUMERIC(5, 1)")
	private BigDecimal avgScore = (new BigDecimal("0")).setScale(1);

	@Column(name = "TOTAL_RECORD", nullable = false)
	private int totalRecord;

	@Column(name = "GOOD_SCORE", nullable = false, columnDefinition = "NUMERIC(5, 1)")
	private BigDecimal goodScore = (new BigDecimal("0")).setScale(0);

	@Column(name = "MID_SCORE", nullable = false, columnDefinition = "NUMERIC(5, 1)")
	private BigDecimal midScore = (new BigDecimal("0")).setScale(0);

	@Column(name = "LOW_SCORE", nullable = false, columnDefinition = "NUMERIC(5, 1)")
	private BigDecimal lowScore = (new BigDecimal("0")).setScale(0);

	@Column(name = "GOOD_RECORD", nullable = false)
	private int goodRecord = 0;

	@Column(name = "MID_RECORD", nullable = false)
	private int midRecord = 0;

	@Column(name = "LOW_RECORD", nullable = false)
	private int lowRecord = 0;

	@Column(name = "BIG_SIZE", nullable = false, columnDefinition = "NUMERIC(5, 1)")
	private BigDecimal bigSize = (new BigDecimal("0")).setScale(0);

	@Column(name = "MID_SIZE", nullable = false, columnDefinition = "NUMERIC(5, 1)")
	private BigDecimal midSize = (new BigDecimal("0")).setScale(0);

	@Column(name = "SMALL_SIZE", nullable = false, columnDefinition = "NUMERIC(5, 1)")
	private BigDecimal smallSize = (new BigDecimal("0")).setScale(0);

	public String getProductId() {
		return productId;
	}

	public void setProductId(String productId) {
		this.productId = productId;
	}

	public BigDecimal getAvgScore() {
		return avgScore;
	}

	public void setAvgScore(BigDecimal avgScore) {
		this.avgScore = avgScore;
	}

	public BigDecimal getGoodScore() {
		return goodScore;
	}

	public void setGoodScore(BigDecimal goodScore) {
		this.goodScore = goodScore;
	}

	public BigDecimal getMidScore() {
		return midScore;
	}

	public void setMidScore(BigDecimal midScore) {
		this.midScore = midScore;
	}

	public BigDecimal getLowScore() {
		return lowScore;
	}

	public void setLowScore(BigDecimal lowScore) {
		this.lowScore = lowScore;
	}

	public BigDecimal getBigSize() {
		return bigSize;
	}

	public void setBigSize(BigDecimal bigSize) {
		this.bigSize = bigSize;
	}

	public BigDecimal getMidSize() {
		return midSize;
	}

	public void setMidSize(BigDecimal midSize) {
		this.midSize = midSize;
	}

	public BigDecimal getSmallSize() {
		return smallSize;
	}

	public void setSmallSize(BigDecimal smallSize) {
		this.smallSize = smallSize;
	}

	public int getTotalRecord() {
		return totalRecord;
	}

	public void setTotalRecord(int totalRecord) {
		this.totalRecord = totalRecord;
	}

	public int getGoodRecord() {
		return goodRecord;
	}

	public void setGoodRecord(int goodRecord) {
		this.goodRecord = goodRecord;
	}

	public int getMidRecord() {
		return midRecord;
	}

	public void setMidRecord(int midRecord) {
		this.midRecord = midRecord;
	}

	public int getLowRecord() {
		return lowRecord;
	}

	public void setLowRecord(int lowRecord) {
		this.lowRecord = lowRecord;
	}

	@Transient
	public int getIntAvgScore() {
		if (null != avgScore && avgScore.compareTo(BigDecimal.ZERO) == 1) {
			return avgScore.intValue();
		}
		return 0;
	}

}
